import { useCallback } from "react"
import { SearchLabelManager } from "../../designer/service";
import { useSearchUIDispatch } from "./useSearchUIDispatch";

export const useSearchLabelManager = () => {
    const dispatch = useSearchUIDispatch();
    return useCallback(async () => {
        return SearchLabelManager().then((res) => {
            dispatch({
                myLabels: res.labels,
            });
        });
    }, [dispatch]);
}